package com.shop.shop.controller;


import com.shop.shop.dao.UserMapper;
import com.shop.shop.model.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserMapper userMapper;
    @RequestMapping("/user")
    public String user(){
        User user=new User();
        user.setName("shopuser");
        return user.toString();
    }

    @RequestMapping("/get")
    public String getUser(){
        List<User> userList=userMapper.getAllUser();
        for (User user:userList){
            System.out.println(user.toString());
        }
        return "";
    }
}
